﻿<Window x:Class="HMS.UserWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
        xmlns:xctk="clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended"
        Style="{StaticResource ControlBackgroundStyle}"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        Title="User"
        Height="302" Width="494" >
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />

        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <StackPanel Orientation="Vertical" Grid.Row="0">

                <GroupBox Header="Login Details" Grid.Row="0"  Background="{x:Null}">
                    <WrapPanel Orientation="Vertical">
                        <StackPanel Name="ReferenceStackPanel"  Orientation="Horizontal">
                            <Label Content="Reference:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <toolkit:AutoCompleteBox Name="ReferenceAutocompleteTextBox" 
                                                 ItemsSource="{Binding}"
                                                 ValueMemberPath="UserName"
                                                 ToolTipService.ToolTip="Enter User Name."
                                                 IsTextCompletionEnabled="True"
                                                 Style="{StaticResource LeftAlignedControlAutoCompleteTextBoxStyle}" 
                                                 FilterMode="StartsWith" SelectionChanged="ReferenceAutocompleteTextBox_SelectionChanged">
                                <toolkit:AutoCompleteBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Path=Reference}"/>
                                            <TextBlock Text="-"/>
                                            <TextBlock Text="{Binding Path=UserName}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:AutoCompleteBox.ItemTemplate>
                            </toolkit:AutoCompleteBox>
                        </StackPanel>
                        <StackPanel  Orientation="Horizontal">
                            <Label Content="User Name:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <TextBox Style="{StaticResource LeftAlignedControlTextBoxStyle}" Name="UserNameTextBox" />
                        </StackPanel>
                        <StackPanel  Orientation="Horizontal">
                            <Label Content="Password:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <PasswordBox Style="{StaticResource LeftAlignedControlPasswordBoxStyle}" Name="PasswordTextBox"/>
                        </StackPanel>
                      
                    </WrapPanel>
                </GroupBox>
                
                <GroupBox Header="Permission Details" Grid.Row="0" Background="{x:Null}">
                    <WrapPanel Orientation="Vertical">
                        <StackPanel  Orientation="Horizontal">
                            <Label Content="User Type:" Style="{StaticResource RightAlignedControlLabelStyle}" />
                            <ComboBox Name="UserTypeComboBox"  Style="{StaticResource LeftAlignedControlComboboxBoxStyle}"
                                  SelectedValuePath="UserTypeID" 
                                  DisplayMemberPath="Name"
                                  ItemsSource="{Binding}"/>
                        </StackPanel>
                        <StackPanel   Orientation="Horizontal" HorizontalAlignment="Left">
                            <StackPanel Orientation="Horizontal">
                                <Label Content="Active :" Style="{StaticResource RightAlignedControlLabelStyle}" />
                                <CheckBox Name="IsUserActiveCheckBox" IsChecked="True" Style="{StaticResource LeftAlignedControlCheckBoxStyle}"  />
                            </StackPanel>
                        </StackPanel>
                    </WrapPanel>

                </GroupBox>

            </StackPanel>
            <GroupBox Header="Summary" Grid.Row="0" HorizontalAlignment="Stretch" Background="{x:Null}">
                <WrapPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock   FontSize="13" Style="{StaticResource RightAlignedControlTextBlockStyle}">Last Login:</TextBlock>
                        <TextBlock Name="LastLoginTextBlock"  FontSize="16" Style="{StaticResource LeftAlignedControlTextBlockStyle}">00/00/0000</TextBlock>
                    </StackPanel>                
                </WrapPanel>
            </GroupBox>
        </StackPanel>
        <Rectangle  Grid.Row="1"  Style="{StaticResource HorizontalLineStyle }" />
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="NewButton"  Style="{StaticResource LargeButtonStyle}" Click="NewButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image   Source="images/icons/24x24/new.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock  FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">New</TextBlock>
                </StackPanel>
            </Button>
            
            <Button Name="SaveButton"  Style="{StaticResource LargeButtonStyle}" Click="SaveButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/right.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Save</TextBlock>
                </StackPanel>
            </Button>          
            <Button Name="CancelButton"  Style="{StaticResource LargeButtonStyle}" Click="CancelButton_Click">
                <StackPanel Orientation="Horizontal" >
                    <Image Source="images/icons/24x24/cross.png" Style="{StaticResource Image24x24Style}" />
                    <TextBlock FontSize="16" Style="{StaticResource ButtonTextControlTextBlockStyle}">Close</TextBlock>
                </StackPanel>
            </Button>
        </StackPanel>


    </Grid>
</Window>

